package com.chen.wow.day04.AOP;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes=MyConfig.class)
public class TestAspect {
	@Autowired
	public Performance performance;//接口，不要用Movie
	
	@Test
	public void play(){
		performance.perform();
		Encoreable encoreable = (Encoreable) performance;//通过强转，可以使用新接口的方法
		encoreable.performEncore();
	}
}

